const sql = require("../../../config/web-question-config");

// 获取banner
function getClassification() {
  return sql("select * from classification");
}
// 是否展示classification
function showClassification(arr) {
  return sql("update classification set isShow = ? where classi_id = ?", arr);
}
// 是否展示classification的new
function newClassification(arr) {
  return sql("update classification set isNew = ? where classi_id = ?", arr);
}
// 添加classification
function addClassification(arr) {
  return sql("insert into classification value (NULL,?,?,1,?,?,?,1)", arr);
}

// 更新classification
function updateClassification(arr) {
  return sql(
    "update classification set src = ? , atime = ?,atitle=?,remaks=? where  classi_id = ?",
    arr
  );
}
// 删除banner
function deleteClassification(arr) {
  return sql("delete from classification  where classi_id = ?", arr);
}
function batchClassification(arr) {
  return sql(`delete from classification  where id in(${arr})`);
}
module.exports = {
  getClassification,
  showClassification,
  newClassification,
  addClassification,
  updateClassification,
  deleteClassification,
  batchClassification,
};
